import CanvasInputEvent from "./CanvasInputEvent";
import Vector2 from "../maths/Vector2";
import EInputEventType from "../enums/EInputEventType";

export default class CanvasMouseEvent extends CanvasInputEvent {
    // button表示当前按下鼠标哪个键
    // [0:鼠标左键,1:鼠标中键,2:鼠标右键]
    public button: number;
    // 基于canvas坐标系的表示
    public canvasPosition: Vector2;
    public localPosition: Vector2;
    public hasLocalPosition: boolean;

    public constructor(type: EInputEventType, canvasPos: Vector2, button: number, altKey: boolean = false, ctrlKey: boolean = false, shiftKey: boolean = false) {
        super(type, altKey, ctrlKey, shiftKey);
        this.canvasPosition = canvasPos;
        this.button = button;
        this.hasLocalPosition = false;
        // 暂时创建一个vec2对象
        this.localPosition = Vector2.create();
    }
}